package com.kefu.call.vo;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import com.kefu.basic.model.BasicStatusConfig;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractUpdateVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.validation.constraints.NotEmpty;
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "修改状态")
public class CallStatusConfigUpdateVo extends AbstractUpdateVo<BasicStatusConfig, String> {
    @NotEmpty
    @ApiModelProperty(value = "主键")
    private String id;

    @ApiModelProperty(value = "状态名称")
    private String statusName;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "状态图标")
    private String statusIcon;

    @ApiModelProperty(value = "状态,1=正常，0=禁用")
    private Integer status;

    @Override
    public BasicStatusConfig convert() {
        BasicStatusConfig info = BeanUtil.toBean(this, BasicStatusConfig.class);
        info.setUpdateTime(DateUtil.current());
        info.setUpdateUser(KefuContext.getUid());
        return info;
    }
}
